﻿<%@ Page Language="C#" AutoEventWireup="true" Inherits="WorkFlow_WFProcess_ViewOpinionPaint" Codebehind="ViewOpinionPaint.aspx.cs" %>
<%@ Register Src="../Control/WFTitle.ascx" TagName="WFTitle" TagPrefix="uc1" %>
<%@ Import Namespace="Honestysoft.Workflow.Model" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>流程查看</title>
    <base target="_self" />
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
    <meta http-equiv="Pragma" content="no-cache" />
       <meta http-equiv="Cache-Control" content="no-cache"/>
       <meta http-equiv="Expires" content="0"/>  
    <link href="../css/repeat/CSS/listTable.css" rel="stylesheet" type="text/css" />
    <link href="../Styles/control.css" rel="stylesheet" type="text/css" />
     <style type="text/css">
        body
        {
            font-size:12px;
        }
        </style>
</head>
<body>
    <form id="form1" runat="server">    
    <div align="center" style="vertical-align:top">
        <table width="98%">
            <tr height="40px">
                <td style="width: 100%">
                    <uc1:WFTitle ID="WFTitle1" runat="server" />                    
                </td>
            </tr>
            <tr height="360px" valign="top" align="left">
                <td style="width: 100%">
                    <div style="overflow-x:hidden;overflow-y:scroll;height:358px">
              
                        <table border="1" cellpadding="0" cellspacing="0" class="treeDataTable infogrid" id="treeDataTable"  style="width:98%;">            
                        <asp:Repeater ID="Repeater1" runat="server" OnItemCreated="Repeater1_ItemCreated"
                            OnItemDataBound="Repeater1_ItemDataBound" >
                            <ItemTemplate>                            
                                <tr class="treeDataTr2" id='treeTr<%# DataBinder.Eval(Container.DataItem,"SignSerial") %><%# ((WFOpinion)Container.DataItem).ActTemplate.IsDisplayTransact==((int)WFEnumData.Flag.No).ToString()  ? "u" : "" %><%# ((WFOpinion)Container.DataItem).IsFromBack  ? "b" : "" %>'>
			                    <td style="width:100px">
			                        <div class="minusIcon" style="float:left" onClick="expandTreeTr(this,'<%# DataBinder.Eval(Container.DataItem,"SignSerial") %>')">
			                        </div>
			                        <div style="float:left">
			                            <asp:Label ID="lblActTemplateName"  runat="server"></asp:Label>			                            
			                        </div>
			                    </td>
			                    <td valign="top" style="padding:0;">
			                        <table id="tInfo<%# DataBinder.Eval(Container.DataItem,"SignSerial") %>" width="100%" height="100%" style="background-color:Transparent;" border="0" cellpadding="0" cellspacing="1">
                                        <tr>
                                            <td colspan="3" valign="top" style="padding:0;">
                                                <asp:TextBox ID="txtOpinion" ReadOnly="true" runat="server" Rows="3" Text='<%# DataBinder.Eval(Container.DataItem,"Opinion") %>' TextMode="MultiLine" Width="98%"></asp:TextBox></td>
                                        </tr>
                                        <tr>
                                            <td style="width:33%">
                                                处理人:<asp:Label ID="lblEmployee"  runat="server"></asp:Label></td>                                           
                                            <td  style="width:33%">
                                                处理时间:<%# !((WFOpinion)Container.DataItem).TranTime.HasValue ? "" : string.Format("{0:yyyy-MM-dd}",DataBinder.Eval(Container.DataItem,"TranTime")) %></td>                                            
                                            <td>
                                                <asp:Label ID="lblResult"  runat="server"></asp:Label></td>
                                            
                                        </tr>
			                        </table>
			                        </td>
		                        </tr>
                            </ItemTemplate>
                        </asp:Repeater>
                        </table>
                    </div>
                </td>
            </tr>
            <tr>
                <td align="left">
                    &nbsp;&nbsp;<asp:Label Text="" ID="lblInfo" ForeColor="red" Font-Bold="true" runat="server"></asp:Label>
                </td>
            </tr>
            <tr height="25px">                                
                <td style="width: 100%" align="right">                    
                    <table width="100%">
                    <tr>
                    <td align="left">
                        &nbsp;&nbsp;<input id="chkUnDisplay" onpropertychange="mSetBack();mSetUnDisplay();"  type="checkbox" />显示隐藏的环节
                        &nbsp;&nbsp;<input id="chkBack"  onpropertychange="mSetUnDisplay();mSetBack();"  type="checkbox" />隐藏退回的环节                        
                    </td>
                     <td>  
                      <asp:Button ID="btnCancel" runat="server" Text="取  消"  class="btn_normal" onmouseover="this.className='btn_active'" onmouseout="this.className='btn_normal'" OnClientClick="window.close();" />&nbsp;&nbsp;&nbsp;&nbsp;                      
                    </td>
                    </tr>
                    </table>                    
                </td>
            </tr>
        </table>
    </div>   
    </form>
    <script language="javascript" type="text/javascript">
    mSetUnDisplay();
    function mSetResult()
    {
        var tds = document.getElementsByTagName("td");
        for(i=0;i<tds.length;i++)
        {
            if(tds[i].id == ""){continue;}
            if(tds[i].id.indexOf("tdResult")>=0)
            {
                if(document.getElementById("chkResult").checked)
                {
                    tds[i].style.display = "none";
                }
                else
                {
                    tds[i].style.display = "block";
                }
            }       
        }
    }
    function mSetUnDisplay()
    {
        var tds = document.getElementsByTagName("tr");
        for(i=0;i<tds.length;i++)
        {
            if(tds[i].id == ""){continue;}
            if(tds[i].id.indexOf("treeTr")>=0)
            {
                if(tds[i].id.indexOf("u")>=0)
                {
                    if(document.getElementById("chkUnDisplay").checked)
                    {                        
                        tds[i].style.display = "block";                       
                    }
                    else
                    {
                        tds[i].style.display = "none"; 
                    }
                }
            }       
        }
    }
    function mSetBack()
    {
        var tds = document.getElementsByTagName("tr");
        for(i=0;i<tds.length;i++)
        {
            if(tds[i].id == ""){continue;}
            if(tds[i].id.indexOf("treeTr")>=0)
            {
                if(tds[i].id.indexOf("b")>=0)
                {                                
                    if(document.getElementById("chkBack").checked)
                    {
                        tds[i].style.display = "none";                        
                    }
                    else
                    {
                        tds[i].style.display = "block";
                    }
                    var thisID=tds[i].id;
                    var serial=parseInt(thisID.substr(6,thisID.indexOf("b") - 6));
                    for(j=0;j<tds.length;j++)
                    {
                        if(tds[j].id == ""){continue;}
                        if(tds[j].id.indexOf("treeTr"+(serial-1))>=0)
                        {
                            if(document.getElementById("chkBack").checked)
                            {  
                                document.getElementById(tds[j].id).style.display = "none";     
                            }
                            else
                            {
                                document.getElementById(tds[j].id).style.display = "block";
                            }
                            break;
                        }       
                    }
                }
            }       
        }
    }
    // 树状结构数据表格的收缩展开，只支持两级
    function  expandTreeTr(oIcon,pId){
	    if(!document.getElementById("treeTr"+pId))return;
	    var sDis
	    if(oIcon.className == "plusIcon")
	    {
		    sDis = "block";
	    }
	    else{
		    sDis = "none";		
		    
        }
        document.getElementById('tInfo'+pId).style.display=sDis;
	    //doSHTreeTr("treeTr"+pId,sDis);    	
	    if(oIcon.className == "minusIcon")
		    oIcon.className = "plusIcon";
	    else
		    oIcon.className = "minusIcon";    		
    }

    function doSHTreeTr(pId,dis){
	    var i = 1;
	    while(oTr = document.getElementById(pId+"_"+i)){
		    oTr.style.display = dis;    		
		    i++;
	    }
    }
    
    </script>
</body>
</html>
